package org.example.dormsystem.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.dormsystem.pojo.StudentReply;

import java.util.List;

@Mapper
public interface StudentReplyMapper {

    @Insert("insert into studentReply(message,postDate,postedBy,boardId) values(#{message},now(),#{postedBy},#{boardId})")
    void add(StudentReply studentReply);

    @Select("select * from studentReply where boardId = #{studentBoardId}")
    List<StudentReply> findReplysByStudentBoardId(Integer studentBoardId);
}
